/**
 * 
 */

package CCT220_Aula15_Exercicio01_13106;


import java.io.Serializable;


/**
 * </br>******************************
 * </br>Project: CCT220
 * </br>Package: CCT220_Aula15_Exercicio01_13106
 * </br>Class: Disciplina
 * </br>Last Change: 05/10/2011 20:14:08
 * </br>Description: Entity of Disciplina
 * </br>******************************</br>
 * 
 * @author marcel
 * @author 13106
 * 
 */
public class Disciplina implements Serializable {

	/**
     * 
     */
	private static final long serialVersionUID = 1L;
	private int               codigo;
	private String            nome;
	private int               cargaHoraria;


	/**
	 * </br>******************************
	 * </br>Constructor for
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>LastChange: 05/10/2011 20:14:34
	 * </br>******************************</br>
	 * 
	 * @param pCodigo
	 * @param pNome
	 * @param pCargaHoraria
	 * @throws Exception
	 */
	public Disciplina(int pCodigo, String pNome, int pCargaHoraria)
	        throws Exception {

		setCodigo(pCodigo);
		setNome(pNome);
		setCargaHoraria(pCargaHoraria);
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>Field: codigo
	 * </br>Last Change: 05/10/2011 20:15:36
	 * </br>Description: Geter for codigo
	 * </br>******************************</br>
	 * 
	 * @return the codigo
	 */
	public int getCodigo() {

		return codigo;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>Field: nome
	 * </br>Last Change: 05/10/2011 20:15:36
	 * </br>Description: Geter for nome
	 * </br>******************************</br>
	 * 
	 * @return the nome
	 */
	public String getNome() {

		return nome;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>Field: cargaHoraria
	 * </br>Last Change: 05/10/2011 20:15:36
	 * </br>Description: Geter for cargaHoraria
	 * </br>******************************</br>
	 * 
	 * @return the cargaHoraria
	 */
	public int getCargaHoraria() {

		return cargaHoraria;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>Field: codigo
	 * </br>Last Change: 05/10/2011 20:15:36
	 * </br>Description: Seter for codigo
	 * </br>******************************</br>
	 * 
	 * @param codigo
	 *            the codigo to set
	 */
	public void setCodigo(int codigo) {

		this.codigo = codigo;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>Field: nome
	 * </br>Last Change: 05/10/2011 20:15:36
	 * </br>Description: Seter for nome
	 * </br>******************************</br>
	 * 
	 * @param nome
	 *            the nome to set
	 */
	public void setNome(String nome) {

		this.nome = nome;
	}


	/**
	 * </br>******************************
	 * </br>Package: CCT220_Aula15_Exercicio01_13106
	 * </br>Class: Disciplina
	 * </br>Field: cargaHoraria
	 * </br>Last Change: 05/10/2011 20:15:36
	 * </br>Description: Seter for cargaHoraria
	 * </br>******************************</br>
	 * 
	 * @param cargaHoraria
	 *            the cargaHoraria to set
	 * @throws Exception
	 */
	public void setCargaHoraria(int cargaHoraria) throws Exception {

		if ((cargaHoraria < 30) || (cargaHoraria > 110)) { throw new Exception(
		        "A carga horária deve estar entre 30 e 110 horas."); }
		this.cargaHoraria = cargaHoraria;
	}

}
